/*
 * Copyright 2025 The Android BYOD Project
 */

package com.example.testble;

import android.os.Parcel;
import android.os.Parcelable;

import androidx.annotation.NonNull;

/** ByodDeviceInfo */
public class ByodDeviceInfo implements Parcelable {
    private String btAddress = "";
    private String btName = "";
    private String deviceId = "";
    private String deviceName = "";
    private int width;
    private int height;
    private boolean btPaired;

    public String getBtAddress() {
        return btAddress;
    }

    public void setBtAddress(String btAddress) {
        this.btAddress = btAddress;
    }

    public String getBtName() {
        return btName;
    }

    public void setBtName(String btName) {
        this.btName = btName;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public String getDeviceName() {
        return deviceName;
    }

    public void setDeviceName(String deviceName) {
        this.deviceName = deviceName;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public boolean isBtPaired() {
        return btPaired;
    }

    public void setBtPaired(boolean btPaired) {
        this.btPaired = btPaired;
    }

    public void clone(ByodDeviceInfo byodDeviceInfo) {
        btAddress = byodDeviceInfo.getBtAddress();
        btName = byodDeviceInfo.getBtName();
        btPaired = byodDeviceInfo.isBtPaired();
    }

    @Override
    public String toString() {
        return "ByodDeviceInfo{"
                + "btAddress='"
                + btAddress
                + '\''
                + ", btName='"
                + btName
                + '\''
                + ", deviceId='"
                + deviceId
                + '\''
                + ", deviceName='"
                + deviceName
                + '\''
                + ", width="
                + width
                + ", height="
                + height
                + ", btPaired="
                + btPaired
                + '}';
    }

    public ByodDeviceInfo() {}

    protected ByodDeviceInfo(Parcel in) {
        this.btAddress = in.readString();
        this.btName = in.readString();
        this.deviceId = in.readString();
        this.deviceName = in.readString();
        this.width = in.readInt();
        this.height = in.readInt();
        this.btPaired = in.readBoolean();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(@NonNull Parcel dest, int flags) {
        dest.writeString(btAddress);
        dest.writeString(btName);
        dest.writeString(deviceId);
        dest.writeString(deviceName);
        dest.writeInt(width);
        dest.writeInt(height);
        dest.writeBoolean(btPaired);
    }

    public void readFromParcel(Parcel in) {
        this.btAddress = in.readString();
        this.btName = in.readString();
        this.deviceId = in.readString();
        this.deviceName = in.readString();
        this.width = in.readInt();
        this.height = in.readInt();
        this.btPaired = in.readBoolean();
    }

    public static final Creator<ByodDeviceInfo> CREATOR =
            new Creator<ByodDeviceInfo>() {
                @Override
                public ByodDeviceInfo createFromParcel(Parcel in) {
                    return new ByodDeviceInfo(in);
                }

                @Override
                public ByodDeviceInfo[] newArray(int size) {
                    return new ByodDeviceInfo[size];
                }
            };
}
